<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>

    <title>个人资料</title>
    <style>
        .userinformation{
            width: 100%;
            height: 100%;
            text-align: center;
            line-height: 50px;
        }
    </style>
</head>
<!--
    备注:可能会合并到community.html页面, 具体结果看我到时候会不会用内联框架
    基本功能: 
    用户名 手机号 邮箱 性别
-->
<body>
    <div class="userinformation">
        <img src="https://gitee.com/konjac_wjh/pig-go/raw/master/img/user.png" alt="user" style="width: 100px; margin-top: 20px;">
        <div id="show" class="container">
            <div id="username">
                <p><h5>用户名：</h5>{{user.username}}</p>
            </div>
            <div id="phonenumber" >
                <p><h5>电话：</h5>{{user.phone}}</p>
            </div>
            <div id="gender">
                <p><h5>性别：</h5>{{user.gender}}</p>
            </div>
            <div><button type="button" class="btn btn-primary">编辑我的信息</button></div>
        </div>
    </div>
</body>
</html>

<script src="../js/axios-min.js"></script>
<script src="../js/vue.js"></script>
<script>
    new Vue({
        el:"#show",
        data(){
            return{
                user:""
            }
        },
        mounted(){
            //页面加载完成，发送axios的异步请求
            var _this = this;
            axios({
                method:"post",
                url:"../User/suis"
            }).then(function (resp) {
                _this.user = resp.data;
            })
        }
    })

</script>